<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('appointments', function (Blueprint $table) {
            $table->increments('appointmentid');
            $table->string('username',8);
            $table->string('dressname',8);
            $table->date('appointmenttime');
            $table->string('tel',11);
            $table->string('address',50);
            $table->string('state',10);
            $table->foreign('username')->references('username')->on('users');
            $table->foreign('dressname')->references('dressname')->on('wedding_dresses');
        });
    }

    public function down()
    {
        Schema::dropIfExists('appointments');
    }
};
